<template>
  <div class="proDe">
    <acManageTitle>
      <template #right>
        <span class="rightName">档案详情页面</span>
      </template>
    </acManageTitle>
    <div class="Actiontitle">档案详情</div>
    <router-link to="/growthProfile"
      ><button class="selection1">返回</button></router-link
    >
    <button class="selection2">上一位</button>
    <button class="selection3">下一位</button>
    <div class="center">
      <div class="content">
        <div class="c1">
          <div>
            <span class="a">呵护对象：</span>
            <span class="b">莉莉（化名）</span>
          </div>
          <div><span class="a">性别：</span><span class="b">女</span></div>
          <div><span class="a">年龄：</span><span class="b">15</span></div>
          <div><span class="a">家长：</span><span class="b">苏保平</span></div>
          <div><span class="a">教师：</span><span class="b">张俊华</span></div>
          <div>
            <span class="a">居委会：</span>
            <span class="b">楚江街道荷花社区居委会</span>
          </div>
        </div>
        <div class="c2">
          症状解剖
          <div class="btn1">
            <div class="btn2">社交障碍</div>
            <div class="btn2">回避</div>
          </div>
          <div class="btn1">
            <div class="btn2">焦躁</div>
            <div class="btn2">情感障碍</div>
          </div>
          <div class="btn1">
            <div class="btn2">失眠</div>
            <div class="btn2">缺乏沟通</div>
          </div>
        </div>
        <div class="c3">
          帮扶状态
          <div class="status">
            <div class="circle"></div>
            <span class="aa">帮扶完成，</span><span class="bb">追随调查</span
            ><span class="aa">中</span>
          </div>
        </div>
        <div class="c4"></div>
      </div>
    </div>
    <div class="bottom">
      <div class="bottom-left">
        心理状况监测
        <div class="trend" ref="growthProfile1_ref"></div>
      </div>
      <div class="bottom-right">
        教育方案
        <div class="select">
          <div id="s1" @mouseover="setTab('s', 1, 4)">心理治疗</div>
          <div id="s2" @mouseover="setTab('s', 2, 4)">情绪辅导</div>
          <div id="s3" @mouseover="setTab('s', 3, 4)">社交治疗</div>
          <div id="s4" @mouseover="setTab('s', 4, 4)">改善生存环境</div>
        </div>
        <div class="show">
          <div id="con_s_1" style="display: block">
            每次交流让莉莉谈谈近来的心理感受及状况，肯定她接受心理咨询的举动，给予充分的同感并肯定其积极和成长一面，在她面前体现出亲切感，平易感，为的是使她在不知不觉中重建自信心。
          </div>
          <div id="con_s_2" style="display: none">
            分析莉莉的情绪推理“我觉得我像一个失败的人，所以我是一个失败的人”。这种“跟着感觉走”的情绪推理，阻碍了来访者对事物真实情况的了解，使其陷于认知曲解而不能自拔。
            向莉莉介绍行为矫正技术，要求来访者回忆、体验自己过去自感成功的情境，想象自己未来理想状态下的表现，并要求其牢记积极的情绪体验。
          </div>
          <div id="con_s_3" style="display: none">
            通过和她父母沟通，让家长给予她更多的关爱，用温暖的心去融化她内心的坚冰：到她家进行家访，把事情跟她父母反映，争取家长们的理解与支持，希望父母亲给予更多的体贴与呵护，重振生活的自信心。
          </div>
          <div id="con_s_4" style="display: none">
            要让女孩树立正确的人生观，以积极的心态去对待自己和社会;还要引导她们去追求社会性、精神性的需要，从逆境中奋起。自强不息。只有这样，才能增进她们抗衡迷乱的能力，才能有信心去面对崭新的明天。
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import acManageTitle from '@/components/acManageTitle.vue'
export default {
  components: {
    acManageTitle: acManageTitle
  },
  // mounted加载的时候，函数里面为空，加载出的页面也会一片空白
  mounted() {
    this.initEcharts()
  },
  methods: {
    setTab(name, cursel, n) {
      /*html页面调用js文件里的函数，写法必须为dosave = function (){}形式，html是on触发事件，vue.js是@即v-on*/
      let i
      for (i = 1; i <= n; i++) {
        var menu = document.getElementById(name + i)
        var con = document.getElementById('con_' + name + '_' + i)
        menu.className = i == cursel ? 'hover' : '' // id>class,id样式也是class样式
        con.style.display = i == cursel ? 'block' : 'none'
      }
    },
    initEcharts() {
      let echarts = this.$ECharts.init(this.$refs.growthProfile1_ref)
      // const xArr = ['2016', '2017', '2018', '2019', '2020', '2021'] // data()中的数据才能被methods内所有方法引用
      // const y1Arr = [130400, 354200, 615400, 1250000, 1710000, 2160000]
      const option = {
        xAxis: {
          type: 'category',
          name:"时间",
          min:0,
          max:24,
          axisLabel: {
            interval: 0, //横轴信息全部显示
            rotate: -5, //-30度角倾斜显示
            textStyle: {
              color: '#c3dbff', //更改坐标轴文字颜色
              fontSize: 8 //更改坐标轴文字大小
            }
          },
          axisLine: {
            show: true,
            lineStyle: {
              color: '#fff'
            }
          }
        },
        yAxis: {
          type: 'value',
          name: '心理健康指数（分）',
          min: 0,
          max: 100,
          splitLine: {
            show: false
          },
          axisLine: {
            show: true,
            lineStyle: {
              // color: 'rgb(128,1,1)'
              color:"#fff"
            }
          }
        },
        series: [
          {
            data:[77,54,75,54,81,95,86,64,48,51,84,51,54,65,68,48,68,49,85,76,88,94,84,68,64],
            type: 'line',
            lineStyle: {
              color: 'rgb(229, 33, 33)' // 加上单引号！
            }
          }
        ]
      }
      echarts.setOption(option)
    }
  }
}
</script>
<style lang="less" scoped>
.rightName {
  font-size: 0.52rem;
  color: #fbb40a;
}
.proDe {
  background-color: rgba(128, 1, 1, 1);
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
}
.Protitle {
  height: 1rem;
  background-color: rgba(128, 1, 1, 1);
  background-size: 0.875rem 0.875rem;
  background-repeat: no-repeat;
  background-position: 15px 2.5px;
  padding-left: 1.5rem;
  .hh {
    height: 1rem;
    display: inline-block;
    font-size: 12px;
    font-weight: bold;
    font-family: monospace;
    line-height: 1rem;
    color: rgb(255, 255, 254);
    //vertical-align: middle;
    //设置line-height没用，行内元素没有宽高
  }
  .h {
    // 利用line-height行高属性，对盒子div很适用，h、span标签不适合。此方法如果兄弟元素有图片img，会默认紧挨底部
    // h标签有margin，手动设置为0，独占一行
    height: 1rem;
    font-size: 20px;
    font-weight: bold;
    line-height: 1rem;
    font-family: monospace;
    display: inline-block;
    color: rgb(225, 191, 1);
    // padding-bottom: 5px;是在文字紧贴底部的情况下下内边距5px
  }
  .button {
    height: 1rem;
    display: inline-block;
    position: absolute;
    right: 0.75rem;
    font-size: 10px;
    line-height: 1rem;
    color: rgb(247, 217, 180);
  }
}
.Actiontitle {
  width: 100%;
  background: url('@/assets/image/导航.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  text-align: center;
  font: normal 500 16px 'monospace';
  margin-top: 0.25rem;
  line-height: 1rem;
  color: rgb(255, 255, 255);
}
.selection1,
.selection2,
.selection3 {
  border: none;
  height: 0.5rem;
  background-color: rgb(216, 116, 0);
  color: rgb(255, 255, 254);
  font: normal 500 8px 'monospace';
  padding: 0;
  position: absolute;
  top: 2.1rem;
}
.selection1 {
  width: 0.75rem;
  left: 1.25rem;
}
.selection2 {
  width: 1rem;
  right: 2.125rem;
}
.selection3 {
  width: 1rem;
  right: 0.75rem;
}
.center {
  width: 100%;
  height: 8rem;
  position: relative;
  margin: 0;
  .content {
    position: relative;
    width: 90%;
    height: 100%;
    margin: 0 5% 0 5%;
    padding-top: 1rem;
    background: url('@/assets/image/background.png');
    background-size: 100% 100%;
    .c1,
    .c2,
    .c3 {
      background-color: rgb(131, 1, 1);
      opacity: 0.8;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      border-style: solid;
      border-radius: 0.125rem;
      border-width: 0.0375rem;
      border-color: #ff000e;
    }
    .c4 {
      position: absolute;
      top: 2.1rem;
      left: 8.4rem;
      width: 4rem;
      height: 3.7rem;
      border-radius: 50%;
      background: url('@/assets/image/lilia.png');
      background-size: 100% 100%;
    }
    .c1 {
      margin-left: 2.9%;
      width: 23%;
      height: 5.5rem;
      padding-left: 0.375rem;
      .a {
        font-size: 20px;
        color: rgb(225, 191, 1);
      }
      .b {
        font-size: 18px;
        font-weight: bold;
        color: #fff;
      }
    }
    .c2 {
      position: absolute; // 绝对定位不占有位置
      right: 2.9rem;
      top: 1.7rem;
      width: 17%;
      height: 3rem;
      color: rgb(225, 191, 1);
      padding-left: 0.125rem;
      padding-top: 0.125rem;
      font-size: 16px;
      .btn1 {
        display: flex;
        justify-content: space-around;
      }
      .btn2 {
        width: 40%;
        //height: 70%; 盒子被文字撑大的高度的70%
        height: 0.5rem;
        display: inline-block;
        background: rgb(171, 0, 19);
        color: rgb(255, 255, 255);
        font-size: 14px;
        text-align: center;
        line-height: 0.5rem;
        border-radius: 0.25rem;
      }
    }
    .c3 {
      width: 20%;
      height: 1.5rem;
      position: absolute;
      right: 1.8rem;
      top: 5.7rem;
      color: rgb(225, 191, 1);
      padding-left: 0.25rem;
      padding-top: 0.0625rem;
      font-size: 16px;
      .status {
        .circle {
          display: inline-block;
          width: 10px;
          height: 10px;
          border-radius: 50%;
          background-color: rgb(225, 191, 1);
        }
        .aa {
          padding-left: 0.125rem;
          color: #fff;
        }
        .bb {
          color: rgb(236, 0, 0);
        }
      }
    }
  }
}
.bottom {
  position: relative;
  top: 1rem;
  // 相对定位边距撑大的部分不算入
  width: 100%;
  height: 3.75rem;
  .bottom-left,
  .bottom-right {
    position: absolute;
    height: 100%;
    color: rgb(226, 69, 0);
    padding-left: 0.375rem;
    padding-top: 0.25rem;
    font-size: 14px;
    border-style: solid;
    border-radius: 0.25rem;
    border-width: 0.0375rem;
    border-color: #ff000e;
  }
  .bottom-left {
    left: 0.75rem;
    width: 40%;
    height: 380px;
    .trend {
      margin-top: 0.75rem;
      width: 100%;
      height: calc(100% - 1rem);
    }
  }
  .bottom-right {
    right: 0.625rem;
    width: 50%;
    height: 380px;
    .select {
      margin-top: 0.375rem;
      width: 100%;
      height: 30%;
      display: flex;
      justify-content: space-around;
      #s1,
      #s2,
      #s3,
      #s4 {
        width: 18%;
        height: 0.65rem;
        background-color: rgb(171, 0, 0);
        font: normal 400 12px 'monospace';
        color:#f5d858;
        text-align: center;
        line-height: 0.65rem;
        border-radius: 0.25rem;
      }
      #s1:hover,
      #s2:hover,
      #s3:hover,
      #s4:hover {
        background-color: rgb(236, 0, 0);
        color: #fff;
        cursor: pointer;
      }
    }
    .show {
      width: 100%;
      height: 90%;
      //background-color: #fff;
      #con_s_1,
      #con_s_2,
      #con_s_3,
      #con_s_4 {
        padding: 0 0.25rem 0 0.25rem;
        font: normal 400 16px 'monospace';
        color: #fff;
      }
    }
  }
}
</style>
